package com.zkzx.operation.api.client.truck;

import com.zkzx.common.truck.command.TruckCommand;
import com.zkzx.common.truck.model.TruckListVO;
import com.zkzx.common.truck.model.TruckVO;
import com.zkzx.common.vo.PageResult;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 *
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/11/15:30
 * @Description:
 */
@FeignClient(value = "ZKZX-TRUCK") // 本地调用 先以接口地址为准进行调用
//@FeignClient(name = "ZKZX-TRUCK",url = "http://localhost:28082")
public interface TruckClient {

    @GetMapping("/ZKZX-TRUCK/trucks")
    @ApiOperation(value = "获取企业列表", notes = "获取企业列表")
    PageResult<TruckListVO> find(@ApiParam(value = "查询参数") @RequestParam("filterParam") String filterParamJson,
                                        @ApiParam(value = "分页查询参数")  @RequestParam("params") String paramsJson) ;


    @GetMapping("/ZKZX-TRUCK/trucks/{id}")
    TruckVO getById(@PathVariable("id") Integer id, @RequestHeader("companyId") Integer companyId, @RequestHeader("userId") Integer userId);


    @PutMapping("/ZKZX-TRUCK/trucks/{id}")
    void update(@PathVariable("id") Integer id,@RequestBody @Valid TruckCommand command,@RequestHeader("userId") Integer userId);



}
